<?php

class Adept_Renderer_Label extends Adept_Renderer_Composite 
{
    
    public function renderBegin($component) 
    {
        $attributes = array(
            'id' => $component->getId(),
            'for' => $component->getFor(),
            'style' => $component->isErrorMode() ? $component->getErrorStyle() : $component->getStyle(),
            'class' => $component->isErrorMode() ? $component->getErrorClass() : $component->getClass(),
        );
        $component->getWriter()->writeHtmlTag('label', $attributes);
    }
    
    public function renderEnd($component)
    {
        $component->getWriter()->write("</label>");
    }

}